package com.lifeng.domain;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * Created by lifeng on 2019/4/28.
 */
@Document(indexName = "test-user", type = "user")
public class User {
    @Id
    private String id;

    @Field(type=FieldType.Keyword) //低版本不支持FieldType.keyword
    private String userName;

    @Field(type=FieldType.Integer)
    private Integer age;

    @Field(type=FieldType.Date)
    private Date birthday;

    @Field(type=FieldType.Text,searchAnalyzer="ik_max_word",analyzer="ik_max_word")
    private String remark;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
